<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title></title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <style>
        .number {
          font-size:0.75rem;
          color:#2a2a2a;
        }

        .time {
            font-size: 0.65rem !important;
            color: #505050;
        }

        .amount {
            text-align: right;
            font-weight: bold !important;
            font-size: 0.8rem !important;
            color: #18af1f !important;
            font-family: Arial !important;
        }
    </style>
</head>

<body>
    <div class="vue">
        <div class="loading" v-if="loading"></div>
        <div class="aui-content aui-margin-b-15">
            <div v-if="!list.length" style="text-align:center;font-size:1rem;margin-top:3rem">无记录</div>
            <ul class="aui-list aui-list-in">
                <li class="aui-list-item" style="padding:0.3rem 0.75rem" v-for="item in list">
                    <div class="aui-list-item-inner" style="padding-right:0">
                        <div class="aui-list-item-title">
                          <div class="number">订单号：{{item.ipsBillNo}}</div>
                          <div class="time">{{item.createTime}}</div>
                        </div>
                        <div class="aui-list-item-right amount" v-if="item.ordersType=='3'">+{{item.orderAmount}}</div>
                        <div class="aui-list-item-right amount" v-if="item.ordersType=='4'" style="color:#ff2600 !important">-{{item.orderAmount}}</div>
                    </div>
                </li>
              </ul>
        </div>
    </div>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/base64.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript">
        apiready = function() {
            api.setRefreshHeaderInfo({
                loadingImg: 'widget://image/refresh.png',
                bgColor: '#ffffff',
                textColor: '#505050',
                textDown: '下拉刷新...',
                textUp: '松开刷新...'
            }, function(ret, err) {
                Ve.getList(function() {
                    Ve.list = []
                    api.refreshHeaderLoadDone();
                })
            });

            api.addEventListener({
                name: 'scrolltobottom',
                extra: {
                    threshold: 15
                }
            }, function(ret, err) {

            });

            var Ve = new Vue({
                el: '.vue',
                data: {
                    loading: true,
                    total: 5,
                    list: [],
                    keyword: ''
                },
                methods: {
                    doSearch: function() {
                        // console.log(this.keyword)
                    },
                    getList: function(callback) {
                        app.request.post('/myhome/queryOrdersList', {
                            customerCode: api.pageParam.customerCode,
                            startTime: api.pageParam.startTime,
                            endTime: api.pageParam.endTime,
                            ordersType: api.pageParam.ordersType,
                            signature: app.sign(api.pageParam.customerCode)
                        }, {}, function(res) {
                            // console.log(JSON.stringify(res))
                            callback && callback()
                            if (res.code == 1) {
                                for (var i in res.orderDetails) {
                                    Ve.list.push(res.orderDetails[i])
                                }
                            } else {
                                app.error(res.msg);
                            }
                            app.loadingFinish(Ve)
                        })
                    }
                },
                created: function() {
                    this.getList()
                }
            })
        }
    </script>
</body>

</html>
